Week 14

 

 

 

 

Interface and application programming

 

 

 

 

Assignment

Write an application that interfaces with an input &/or output device.

 

 

This week I want to be able to control my RGB board with my computer. If my computer mouse goes over a square of red, green or blue on my computer the Led on my board responds with the same color. At first I wrote this simple code in Arduino in order to figure out the colors on my board and I started with red, green and blue. I will set up more colors for my final project. This is a good start. Here is my first code.

 

 

 

Arduino file

 

 

Then I looked at a lot of websites from the FabAcademy 2014 and found Chira Grangholia´s sites but she did exactly what I want to do. I copied her code and then made some changes.

 

 

 

 

Processing file




 

 

Arduino file



 

It worked but not quite the way I wanted it. The light changes when I´m over a square but it never goes off. I´m working on the code in order to figure it out.

 

I made these changes in Processing:

 

 

 

 

Processing file

 

 

And added this to the Arduino code and everything was working the way I want it.

 

 

 

 

 

 

 

 

The way it was before made the light turn on and off really fast but never all the way off. These changes made it so that the light is either on or off.